package gdt.dao.jpa;

import java.util.List;

import gdt.dao.GroupDAO;
import gdt.entity.Group;

public class JPAGroupDAO extends JPAGenericDAO<Group, Long> implements GroupDAO {

	@Override
	@SuppressWarnings("unchecked")
	public List<Group> findAll() {
		return getEntityManager().createQuery("from Group_").getResultList();
	}

	public Group findByName(String name) {
		return (Group) getEntityManager().createNamedQuery("findGroupByName").setParameter("name", name).getSingleResult();
	}


}
